home *** CD-ROM | disk | FTP | other *** search
- #ifndef CLIB_INI_PROTOS_H
- #define CLIB_INI_PROTOS_H
-
- /*
- ** $VER: ini_protos.h 31.00 (16.3.99)
- **
- ** C prototypes. For use with 32 bit integers only.
- **
- ** Copyright © 1999 Seasons.
- ** All Rights Reserved
- */
-
- #ifndef EXEC_TYPES_H
- #include <exec/types.h>
- #endif
- #ifndef LIBRARIES_INI_LIB_H
- #include <libraries/ini_lib.h>
- #endif
-
- /* Miscellanous functions (mainly for coder support) */
- APTR iniAllocPMem( unsigned long byteSize );
- void iniFreePMem( APTR memoryBlock, unsigned long byteSize );
- STRPTR iniAllocNameStr( STRPTR string );
- void iniFreeNameStr( STRPTR namestring );
- STRPTR iniSetString( APTR StructPos, STRPTR string );
- STRPTR iniSetNameStr( APTR StructPos, STRPTR namestring );
-
- /* INI file management */
- struct iniFile *iniOpenDefault( APTR address, STRPTR name,
- unsigned long len );
- struct iniFile *iniOpenFile( STRPTR name, long accessMode );
- struct iniFile *iniOpenFromFH( BPTR fh, unsigned long len );
- struct iniFile *iniOpenMem( APTR address, unsigned long len );
- void iniClose( struct iniFile *iniFile );
- ULONG iniSaveFile( struct iniFile *iniFile, STRPTR name, long accessMode );
- ULONG iniSaveToFH( BPTR fh, struct iniFile *iniFile );
-
- /* INI file context construction functions */
- struct ContextStr *iniCreateContext( STRPTR ContextName );
- void iniFreeContext( struct ContextStr *ContextStr );
- void iniAddContext( struct iniFile *iniFile, struct ContextStr *ContextStr );
- void iniRemContext( struct iniFile *iniFile );
- void iniInsertContext( struct iniFile *iniFile, struct ContextStr *ContextStr,
- struct ContextStr *PredContext );
- void iniDeleteContext( struct ContextStr *ContextStr );
-
- /* INI file context item construction functions */
- struct ContextItemLine *iniCreateContextItem( STRPTR CStr );
- void iniFreeContextItem( struct ContextItemLine *ContextItemLine );
- void iniAddContextItem( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine );
- void iniRemContextItem( struct ContextStr *ContextStr );
- void iniInsertContextItem( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine,
- struct ContextItemLine *PredLine );
- void iniDeleteContextItem( struct ContextItemLine *ContextItemLine );
-
- /* Evaluating INI context and item fields */
- ULONG iniReadLong( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ItemName, unsigned long Default, unsigned long Flags );
- ULONG iniReadFloat( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ItemName, unsigned long Default, unsigned long Flags );
- STRPTR iniReadStr( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ItemName, STRPTR Default, unsigned long Flags );
- BOOL iniReadByteA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags );
- BOOL iniReadWordA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags );
- BOOL iniReadLongA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags );
- BOOL iniReadFloatA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags );
- BOOL iniReadStrA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags );
- ULONG iniWriteLong( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, unsigned long Value, unsigned long Flags,
- unsigned long Format, unsigned long Len, unsigned long ZeroSep );
- ULONG iniWriteFloat( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, unsigned long Value, unsigned long Flags,
- unsigned long FltFormat, unsigned long IntLen, unsigned long FracLen,
- unsigned long ZeroSep );
- ULONG iniWriteStr( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, STRPTR String, unsigned long Flags );
- ULONG iniWriteByteA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags, unsigned long Format, unsigned long Len,
- unsigned long ZeroSep );
- ULONG iniWriteWordA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags, unsigned long Format, unsigned long Len,
- unsigned long ZeroSep );
- ULONG iniWriteLongA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags, unsigned long Format, unsigned long Len,
- unsigned long ZeroSep );
- ULONG iniWriteFloatA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags, unsigned long FloatFormat, unsigned long IntLen,
- unsigned long FracLen, unsigned long ZeroSep );
- ULONG iniWriteStrA( struct iniFile *iniFile, STRPTR ContextName,
- STRPTR ContextItem, APTR Array, unsigned long Entries,
- unsigned long Flags );
-
- /* Low level functions (these evaluate single lines) */
- STRPTR iniGetContextName( STRPTR ContextLine, APTR Buffer );
- STRPTR iniGetContextItem( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Buffer );
- STRPTR iniGetContextItemData( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Buffer );
- STRPTR iniGetContextItemDataA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Buffer,
- unsigned long Number );
- BOOL iniCheckComment( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine );
- ULONG iniGetNumArrays( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine );
- STRPTR iniGetArrayLine( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, unsigned long Number );
- STRPTR iniGetArrayPos( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, unsigned long Number );
- ULONG iniGetLong( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, unsigned long Default );
- ULONG iniGetFloat( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, unsigned long Default );
- STRPTR iniGetStr( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, STRPTR Default );
- ULONG iniGetByteA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries );
- ULONG iniGetWordA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries );
- ULONG iniGetLongA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries );
- ULONG iniGetFloatA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries );
- STRPTR iniGetStrA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries );
- ULONG iniPutLong( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, unsigned long Value,
- unsigned long Format, unsigned long Len, unsigned long ZeroSep );
- ULONG iniPutFloat( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, unsigned long Value,
- unsigned long FltFormat, unsigned long IntLen, unsigned long FracLen,
- unsigned long ZeroSep );
- ULONG iniPutStr( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, unsigned long Value,
- STRPTR String );
- ULONG iniPutByteA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries, unsigned long Format, unsigned long Len,
- unsigned long ZeroSep );
- ULONG iniPutWordA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries, unsigned long Format, unsigned long Len,
- unsigned long ZeroSep );
- ULONG iniPutLongA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries, unsigned long Format, unsigned long Len,
- unsigned long ZeroSep );
- ULONG iniPutFloatA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries, unsigned long FltFormat, unsigned long IntLen,
- unsigned long FracLen, unsigned long ZeroSep );
- ULONG iniPutStrA( struct ContextStr *ContextStr,
- struct ContextItemLine *ContextItemLine, APTR Array,
- unsigned long Entries );
- ULONG iniStrToInt( STRPTR String, unsigned long Default );
- ULONG iniIntToStr( APTR Buffer, unsigned long Integer,
- unsigned long Format, unsigned long Len, unsigned long ZeroSep );
- ULONG iniStrToFloat( STRPTR String, unsigned long Default );
- ULONG iniFloatToStr( APTR Buffer, unsigned long Float,
- unsigned long FltFormat, unsigned long IntLen, unsigned long FracLen,
- unsigned long ZeroSep );
-
- /* INI scan functions (search for contexts, context items) */
- struct ContextStr *iniFindContext( struct iniFile *iniFile,
- STRPTR ContextName, unsigned long Flags );
- struct ContextItemLine *iniFindItem( struct ContextStr *ContextStr,
- STRPTR ContextItemName, unsigned long Flags );
-
- #endif /* CLIB_INI_PROTOS_H */
-